package com.job.Yangmingyu.Zuoye0722.Zuoye1;


import com.job.DQH.dqh722.homework01.AgeException;

import javax.activation.MailcapCommandMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @author Yangmingyu
 * @version 1.0
 * @since 2022-07-22 21:45:13
 */
public class Studenttest {
    public static void main(String[] args) {
        List<Student> stu=new ArrayList<>();
        Random random=new Random();
        int test1;
        for (int i = 0; i <10 ; i++) {
            stu.add(new Student(i+"号",random.nextInt(28)));
            //基本赋值
        }
        for (int i = 0; i <10 ; i++) {
            try{
                test1 = random.nextInt(30)+10;

                stu.get(i).setAge(test1);

                System.out.println(stu.get(i).getName()+"\t"+stu.get(i).getAge());
            }catch (Exception00 e){
                e.printStackTrace();
            }
        }
    }

}